namespace Rob
{
	namespace UI
	{
		public class RunCommandWidget: Rob.UI.ActionWidget
		{
			private Rob.Actions.RunCommand _cmd;

			private Gtk.Entry start;
			private Gtk.Entry end;
			private Gtk.Frame main_frame;
			private Gtk.VBox main_vbox;
			construct
			{
				create_widgets();

			}
			public Rob.Actions.Action action
			{
				get{return _cmd;}
				set{
					this._cmd = (Rob.Actions.RunCommand) value;
					update_values();
				}

			}
			public void update_values()
			{
				this.start.text = this._cmd.start_cmd;
				this.end.text = this._cmd.end_cmd;
			}
			public void create_widgets()
			{
				this.main_frame = new Gtk.Frame("");
				this.main_vbox = new Gtk.VBox( false, 5 );
				this.start = new Gtk.Entry();
				this.end = new Gtk.Entry();
				

				this.start.changed += entry =>
				{
					this._cmd.start_cmd = entry.text;
				};

				this.end.changed += entry =>
				{
					this._cmd.end_cmd = entry.text;
				};

				this.main_frame.add(this.main_vbox);
				this.main_vbox.pack_end_defaults(new Gtk.Label("On Startup: "));
				this.main_vbox.pack_end_defaults(this.start);

				this.main_vbox.pack_end_defaults(new Gtk.Label("At the End: "));
				this.main_vbox.pack_end_defaults(this.end);
			}
		}
	}
}
